import random
import tkinter as tk

def show_warm_tip(tip):
    
        window = tk.Toplevel()
        window.title("温馨提示")
        
        bg_colors = ['lightpink', 'skyblue', 'lightgreen', 'lavender', 
                      'peachpuff', 'lightcyan', 'honeydew', 'mistyrose']
        bg = random.choice(bg_colors)
        
        label = tk.Label(
            window,
            text=tip,
            bg=bg,
            font=('微软雅黑', 16),  # 改用通用字体
            width=30,
            height=2
        )
        label.pack(pady=10)
        
        button = tk.Button(
            window,
            text='好的',
            command=window.destroy,
            font=('微软雅黑', 12)
        )
        button.pack(pady=5)
        
        # 设置窗口位置
        x = random.randint(20, 1300)
        y = random.randint(20, 900)
        window.geometry(f'+{x}+{y}')
        window.attributes('-topmost', True)
        
        
 
def schedule_popups(tips, interval=100, count=10):
    if count > 0:
        current_count = count
        tip_text = random.choice(tips)
        
        show_warm_tip(tip_text)
        
        # 安排下一次弹窗
        root.after(interval, schedule_popups, tips, interval, count - 1)



def main():
    global root
    root = tk.Tk()
   
    root.withdraw()  # 隐藏主窗口
    
    # 在主窗口添加状态标签
    
    tips = [
        "糖糖宝宝想你了！💕",
        "糖糖注意休息哦！💤",
        "每天多喝水哦~💧",
        "记得活动一下！🏃",
        "保护眼睛很重要！👀",
        "上课辛苦啦！💪",
        "保持好心情！😊",
        "上课注意坐姿哦！🪑",
        "妳很棒哒！⭐",
        "妳每天都很棒哦！🚀"
    ]
    schedule_popups(tips, interval=50, count=100)

    root.mainloop()



if __name__ == "__main__":
    
    main()
    
